<html>
<head><meta charset="utf-8"><title>An alternative to inclusion in `std` · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html">An alternative to inclusion in `std`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200566320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200566320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200566320">(Jun 11 2020 at 16:10)</a>:</h4>
<p>Adding common functionality (e.g. json, bstr, _) into the standard library or even core is suggested quite often, in different context. The extra maintenance from that seems not worth it, but instead I wonder if we could make the difference between <code>std</code> and crates smaller for these crates, maybe with some special integration in <code>cargo</code>?</p>



<a name="200566356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200566356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200566356">(Jun 11 2020 at 16:10)</a>:</h4>
<p><span class="user-mention" data-user-id="311038">@qedk</span> <a href="#narrow/stream/122651-general/topic/derive%28debug%29.20and.20serde_json.20in.20std/near/200565743">https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/derive%28debug%29.20and.20serde_json.20in.20std/near/200565743</a><br>
Yes, maybe like a default installation.</p>



<a name="200566801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200566801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200566801">(Jun 11 2020 at 16:13)</a>:</h4>
<p>I don't like this idea. It means that if a better library comes along, its adoption will be slowed by <code>cargo</code> itself, which is the opposite of the idea of a package manager</p>



<a name="200567120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567120">(Jun 11 2020 at 16:16)</a>:</h4>
<p>The main differences I see between <code>std</code> and crates are:</p>
<ul>
<li>Ability to use stability attributes. Actually quite a huge issue for crates on stable versions that can not _test_ new functionality.</li>
<li>A source of truth for what is considered undefined behaviour. That should however not stop adopting good purely safe crates.</li>
<li>No need to query the registry. That might be addressed. What if <code>cargo</code> simply shipped a small offline portion of the registry for the top crates that is updated on each Rust release?</li>
</ul>



<a name="200567400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567400">(Jun 11 2020 at 16:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200566801">said</a>:</p>
<blockquote>
<p>I don't like this idea. It means that if a better library comes along, its adoption will be slowed by <code>cargo</code> itself, which is the opposite of the idea of a package manager</p>
</blockquote>
<p>Not sure what you mean with this? Would it be more work to change, do you refer to a perceived downside?</p>



<a name="200567547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567547">(Jun 11 2020 at 16:19)</a>:</h4>
<p>How do you decide what makes the cut and what does not ?</p>
<p>The idea I'm opposed too is "Cargo should install some libs by default" because if a <code>better_lib</code> comes along its adoption will be slowed by a default being present</p>



<a name="200567570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qedk <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567570">(Jun 11 2020 at 16:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200566801">said</a>:</p>
<blockquote>
<p>I don't like this idea. It means that if a better library comes along, its adoption will be slowed by <code>cargo</code> itself, which is the opposite of the idea of a package manager</p>
</blockquote>
<p>some crates like serde/rand are used by everyone, it's probably okay to just add a flag to cargo  to add a few extra crates and then put that flag somewhere visibly for first-time users</p>



<a name="200567650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qedk <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567650">(Jun 11 2020 at 16:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567547">said</a>:</p>
<blockquote>
<p>How do you decide what makes the cut and what does not ?</p>
<p>The idea I'm opposed too is "Cargo should install some libs by default" because if a <code>better_lib</code> comes along its adoption will be slowed by a default being present</p>
</blockquote>
<p>the same way it's decided what's in std? or what's in &lt;insert some crate&gt;?</p>



<a name="200567701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567701">(Jun 11 2020 at 16:20)</a>:</h4>
<p>Having to write <code>serde = "version"</code> is already <strong>very</strong> easy and more than enough I find</p>



<a name="200567754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567754">(Jun 11 2020 at 16:21)</a>:</h4>
<p>Adoption is slowed currently by simply not being discoverable, as crates search is by downloads and weight. I'm not convinced that adoption of a better library is significantly affected by having only another short list of crates before that search.</p>



<a name="200567772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567772">(Jun 11 2020 at 16:21)</a>:</h4>
<p>I think it's a downside. If you bundle <code>serde_json 1.0.55</code> with the compiler, people will either not want to upgrade to <code>1.0.56</code> or complain about bloat in a default installation. If someone in the first category publishes a crate, they might use a <code>=1.0.55</code> dependency so they don't get <code>1.0.56</code> automatically, and users of that crate will end up with duplicate <code>serde</code> versions in their binaries.</p>



<a name="200567815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567815">(Jun 11 2020 at 16:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="311038">qedk</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567570">said</a>:</p>
<blockquote>
<p>some crates like serde/rand are used by everyone, it's probably okay to just add a flag to cargo  to add a few extra crates and then put that flag somewhere visibly for first-time users</p>
</blockquote>
<p>who is everyone ?</p>



<a name="200567876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567876">(Jun 11 2020 at 16:22)</a>:</h4>
<p>embedded is an important part of rust</p>



<a name="200567902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567902">(Jun 11 2020 at 16:22)</a>:</h4>
<p>And for the most part I don't think they care about serde</p>



<a name="200567926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567926">(Jun 11 2020 at 16:22)</a>:</h4>
<p>This would just be dead weight to them</p>



<a name="200567960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567960">(Jun 11 2020 at 16:22)</a>:</h4>
<p>And for people using protobuff or whatever, should they care about JSON ?</p>



<a name="200567981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200567981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200567981">(Jun 11 2020 at 16:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567120">said</a>:</p>
<blockquote>
<ul>
<li>A source of truth for what is considered undefined behaviour.</li>
</ul>
</blockquote>
<p>Std itself often uses UB that happens to be defined for a specific compiler version. (ex. slice layout) Std also still contains things that are UB on all compiler versions.</p>



<a name="200568146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568146">(Jun 11 2020 at 16:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567981">said</a>:</p>
<blockquote>
<p>Std itself often uses UB that happens to be defined for a specific compiler version. (ex. slice layout) Std also still contains things that are UB on all compiler versions.</p>
</blockquote>
<p>Precisely. Hence the difference. To clarify, I don't think we should endorse crates outside of <code>std</code> to use UB the same way the standard does.</p>



<a name="200568163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568163">(Jun 11 2020 at 16:24)</a>:</h4>
<p>We don't to my knowledge</p>



<a name="200568164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qedk <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568164">(Jun 11 2020 at 16:24)</a>:</h4>
<p>pre-formed packages are quite common and well-used, like Anaconda, it's not necessary that cargo should do this but an alternative installation with more crates and workspaces inbuilt is definitely ideal</p>



<a name="200568210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568210">(Jun 11 2020 at 16:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567547">said</a>:</p>
<blockquote>
<p>The idea I'm opposed too is "Cargo should install some libs by default" because if a <code>better_lib</code> comes along its adoption will be slowed by a default being present</p>
</blockquote>
<p>An example of this is <code>std::sync::mpsc</code>, which is a bit buggy and has a less than optimal api. <code>crossbeam-channel</code> is better, but many people still use <code>std::sync::mpsc</code> because it is included in libstd.</p>



<a name="200568279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568279">(Jun 11 2020 at 16:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="311038">qedk</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200568164">said</a>:</p>
<blockquote>
<p>pre-formed packages are quite common and well-used, like Anaconda, it's not necessary that cargo should do this but an alternative installation with more crates and workspaces inbuilt is definitely ideal</p>
</blockquote>
<p>I hope I'm not coming off as pedantic but in this instance I would say "build the tool yourself", because your use case is not everyone's use case</p>



<a name="200568292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qedk <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568292">(Jun 11 2020 at 16:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200568210">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200567547">said</a>:</p>
<blockquote>
<p>The idea I'm opposed too is "Cargo should install some libs by default" because if a <code>better_lib</code> comes along its adoption will be slowed by a default being present</p>
</blockquote>
<p>An example of this is <code>std::sync::mpsc</code>, which is a bit buggy and has a less than optimal api. <code>crossbeam-channel</code> is better, but many people still use <code>std::sync::mpsc</code> because it is included in libstd.</p>
</blockquote>
<p>that's just an example why inclusion in defaults is better no? convenience over betterness?</p>



<a name="200568337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568337">(Jun 11 2020 at 16:25)</a>:</h4>
<p>std <em>does not</em> invoke UB, it may however do things that are implementation-details of the current compiler.</p>



<a name="200568378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568378">(Jun 11 2020 at 16:26)</a>:</h4>
<p>But we don't want convenience for things that can obviously be better</p>



<a name="200568392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568392">(Jun 11 2020 at 16:26)</a>:</h4>
<p>if std is invoking UB that's a bug and should be reported</p>



<a name="200568420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568420">(Jun 11 2020 at 16:26)</a>:</h4>
<p>No this is an example why inclusion is worse. Because it is included in libstd, almost nobody looks if there is a better alternative.</p>



<a name="200568443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qedk <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568443">(Jun 11 2020 at 16:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307289">Poliorcetics</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200568279">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="311038">qedk</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200568164">said</a>:</p>
<blockquote>
<p>pre-formed packages are quite common and well-used, like Anaconda, it's not necessary that cargo should do this but an alternative installation with more crates and workspaces inbuilt is definitely ideal</p>
</blockquote>
<p>I hope I'm not coming off as pedantic but in this instance I would say "build the tool yourself", because your use case is not everyone's use case</p>
</blockquote>
<p>i'd build the tool myself if i was any good at rust, but i'm not, asking me to do something is useless, i'd not float an idea if i could do it</p>



<a name="200568450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568450">(Jun 11 2020 at 16:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> It does things that a literally undefined towards the user.</p>



<a name="200568505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568505">(Jun 11 2020 at 16:27)</a>:</h4>
<p>no? There's a big difference between "unstable implementation detail" and "UB"</p>



<a name="200568572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568572">(Jun 11 2020 at 16:27)</a>:</h4>
<p>things like <code>FileType::is_file</code> are in the std because they are necessary for portability, but bjorn's example about channels is why rust choose this path: crossbeam could be included in the std to replace mspc but then it could not evolve so freely</p>



<a name="200568669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568669">(Jun 11 2020 at 16:28)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> Yes, inclusion. But the question is if the situation would be any different if it were just the most used library for that job. The same people that do not reach for <code>crossbeam</code>, how or why should they discover the newer library over the established and popular one?</p>



<a name="200568727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568727">(Jun 11 2020 at 16:28)</a>:</h4>
<p>It is a question of trade-offs, and rust choose the opposite of Python IMO: small std and very efficient and well polished external libs</p>



<a name="200568750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568750">(Jun 11 2020 at 16:29)</a>:</h4>
<p>Another example is <code>regex</code></p>



<a name="200568767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200568767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200568767">(Jun 11 2020 at 16:29)</a>:</h4>
<p>it's not in the std</p>



<a name="200569065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569065">(Jun 11 2020 at 16:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200568505">said</a>:</p>
<blockquote>
<p>no? There's a big difference between "unstable implementation detail" and "UB"</p>
</blockquote>
<p>Not to crates. For crates the implications are the same, that they may lead to miscompilation and exploitable security properties in future compiler versions. Just, for UB also for any current compiler.</p>



<a name="200569247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569247">(Jun 11 2020 at 16:32)</a>:</h4>
<p>UB is not something that <em>anyone</em> can utilize, even with "known compiler"</p>



<a name="200569324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569324">(Jun 11 2020 at 16:33)</a>:</h4>
<p>the compiler is free to be non-deterministic with UB etc, you can't rely on it anywhere</p>



<a name="200569444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569444">(Jun 11 2020 at 16:34)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> That's not what I was suggesting, there is no reason why upgrading would be affected. It would be a snapshot of crates and dependencies at each rust release for example. There's no reason why a registry update wouldn't allow upgrading to dependencies when available and the usual dependency discovery means there is no incentive to specify _exact_ versions. Unless I'm overlooking something, please tell me what that incentive would be.</p>



<a name="200569499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569499">(Jun 11 2020 at 16:34)</a>:</h4>
<p>unstable implementation details, however, are fine to rely on in std, as we can update them as needed. even in outside crates it's technically fine, you just need to be clear with that as something you're doing and probably not publish on <a href="http://crates.io">crates.io</a> (or make the functions etc unsafe and say "must be compiled with 1.44.0" or so</p>



<a name="200569586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569586">(Jun 11 2020 at 16:35)</a>:</h4>
<p>You can utilize UB with a known compiler. You can know that the compiler will not do anything non-deterministic when invoking a certain kind of UB. For example C depending on the evaluation order of subexpressions is UB, but I don't know of any compiler that doesn't just choose a certain evaluation order.</p>



<a name="200569590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569590">(Jun 11 2020 at 16:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200569065">said</a>:</p>
<blockquote>
<p>Not to crates. For crates the implications are the same, that they may lead to miscompilation and exploitable security properties in future compiler versions. Just, for UB also for any current compiler.</p>
</blockquote>
<p>I do not agree with that at all. Implementation details are just that, details you can change without breaking your public interface and behavior. It's like a crate-wide <code>impl Behaviour</code>, whereas UB is not something you can rely upon at all. It can make everything work one morning and break everything the following evening</p>



<a name="200569753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569753">(Jun 11 2020 at 16:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200569586">said</a>:</p>
<blockquote>
<p>You can utilize UB with a known compiler. You can know that the compiler will not do anything non-deterministic when invoking a certain kind of UB. For example C depending on the evaluation order of subexpressions is UB, but I don't know of any compiler that doesn't just choose a certain evaluation order.</p>
</blockquote>
<p>Exactly. Saying you can rely on unstable implementation details is like saying you can rely on some UB because you know that the llvm pass to actually exploit it for optimization is off.. No, UB and undefined has no difference in actionability for crates.</p>



<a name="200569782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200569782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200569782">(Jun 11 2020 at 16:37)</a>:</h4>
<p><span class="user-mention" data-user-id="229913">@HeroicKatora</span> it depends on whether you want to ship the source code or a binary version of the crate. I've seen people who wanted compiled versions of the popular crates to be packaged with/next to <code>std</code>. If you ship the source code you don't get much. If you ship compiled code you get faster builds <strong>until</strong> the next release of a crate. If you implicitly include the crate in <code>Cargo.toml</code> you make people asking why <code>rand</code> and <code>serde</code> aren't in<code>std</code> happy.</p>



<a name="200570048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570048">(Jun 11 2020 at 16:39)</a>:</h4>
<p>I was thinking shipping sources for now, the question of binary packages seems like a separate issue to be resolved entirely. It's also one to solve for all crates, in particular proc macros. Maybe the main difference would be that inclusion in such a special distribution would be a definitive sign that the package works on all Tier 1&amp;2 targets.</p>



<a name="200570064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570064">(Jun 11 2020 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> At that point you're not coding against C (or Rust) but rather some specific compiler, which is free to have separate "this is not actually UB" definitions, of course. But rustc at least doesn't do so to my knowledge.</p>



<a name="200570247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570247">(Jun 11 2020 at 16:40)</a>:</h4>
<p>But then how do you observe it? That is, how can you tell that you got the source code of your favourite package from <code>rustup</code> (without looking on disk).</p>



<a name="200570253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570253">(Jun 11 2020 at 16:41)</a>:</h4>
<blockquote>
<p>At that point you're not coding against C (or Rust) but rather some specific compiler</p>
</blockquote>
<p>Libstd is coded against a specific compiler too.</p>



<a name="200570562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570562">(Jun 11 2020 at 16:43)</a>:</h4>
<p>Why not some kind of standard  way of packaging groups of crates that can be installed globally? People could then choose to install, for example, a group called "boost" which comes with a curated selection of common crates like <code>rand</code>, <code>serde</code>, etc which projects can use automatically. The details of managing that automation might be tricky but not necessarily insurmountable.</p>



<a name="200570690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570690">(Jun 11 2020 at 16:44)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> I was thinking it would simply use it, without updating the index like it would do for packages. That is, it would treat it as if a corresponding entry was already in the lock file. Specifically you could still do <code>cargo update -p rand</code> to _force_ an upgrade regardless.</p>



<a name="200570789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570789">(Jun 11 2020 at 16:44)</a>:</h4>
<p>Right, but my point is that (to my knowledge) libstd today does not exploit any spec UB and should not in the future. If that's not the case, then IMO we should fix it. This is strictly different from "spec-not-defined" (e.g., slice layout) IMO, in the sense that those are more so implementation-defined.</p>



<a name="200570833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570833">(Jun 11 2020 at 16:44)</a>:</h4>
<p><span class="user-mention" data-user-id="260325">@Chris Denton</span>  That's maybe an unrelated discussion, but there are discussions about namespaces on <a href="http://crates.io">crates.io</a> like <code>serde/serde</code>, <code>serde/json</code>. You could then download a whole namespace ?</p>



<a name="200570912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200570912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200570912">(Jun 11 2020 at 16:45)</a>:</h4>
<p><span class="user-mention" data-user-id="307289">@Poliorcetics</span> Really seems like a spearate discussion. And yes, there are, have a look around or another stream.</p>



<a name="200571093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200571093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200571093">(Jun 11 2020 at 16:46)</a>:</h4>
<p><span class="user-mention" data-user-id="260325">@Chris Denton</span> maybe you'd like a version of <code>cargo add-friends serde_json</code> which adds <code>serde</code> and <code>serde_json</code> with the popular features to your <code>Cargo.toml</code>?</p>



<a name="200571144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200571144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mental <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200571144">(Jun 11 2020 at 16:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200570690">said</a>:</p>
<blockquote>
<p>Specifically you could still do <code>cargo update -p rand</code> to _force_ an upgrade regardless.</p>
</blockquote>
<p>but at that point you'd always be updating groups of packages and fighting against the pre-installs no?</p>



<a name="200571565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200571565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200571565">(Jun 11 2020 at 16:49)</a>:</h4>
<p>Not sure what you mean with fighting, SemVer still applies and limits the version resolution to compatible ones. Maybe it should be more clearly specified what the 'default' version specifier should be but likely "^1" would work fine for stable packages.</p>



<a name="200572677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200572677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mental <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200572677">(Jun 11 2020 at 16:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200571565">said</a>:</p>
<blockquote>
<p>Maybe it should be more clearly specified what the 'default' version specifier should be but likely "^1" would work fine for stable packages.</p>
</blockquote>
<p>But a lot of the "most downloaded" crates on <a href="http://crates.io">crates.io</a> aren't even <code>1.0</code> e.g. rand_core,  rand, libc, log or unicode-xid, how will it work then?</p>



<a name="200572749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200572749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200572749">(Jun 11 2020 at 16:57)</a>:</h4>
<p>And what's the MSRV of any crate making use of this? What <code>serde</code> am I using? How do I report a bug?</p>



<a name="200572899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200572899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200572899">(Jun 11 2020 at 16:58)</a>:</h4>
<p>It would potentially work by specifying the usual major version dependency instead.</p>



<a name="200573319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200573319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200573319">(Jun 11 2020 at 17:01)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> Sorry if I've misunderstood but, as I understand it, the main issue is that the <code>std</code> is lower friction for many users so they want more included there and they reach for <code>std</code> types even when there are better options.</p>
<p>The goal of some kind of "crate groups" would be to allow people to essentially install their own <code>std</code> alongside Rust's. They could then use it the exact same way they do Rust's <code>std</code>. Not quite as low friction as having the <code>std</code> there out of the box, but near enough. Also instead of having to trust a bunch of different crates, they can deputise that trust to the group maintainers.</p>



<a name="200573346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200573346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200573346">(Jun 11 2020 at 17:01)</a>:</h4>
<p>Hm, maybe it doesn't work without specifying it in <code>Cargo.toml</code> to ensure forward compatibility.</p>



<a name="200573917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200573917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200573917">(Jun 11 2020 at 17:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200573346">said</a>:</p>
<blockquote>
<p>Hm, maybe it doesn't work without specifying it in <code>Cargo.toml</code> to ensure forward compatibility.</p>
</blockquote>
<p>Well, then you end up with what you have today but a lot of effort spent for questionable benefits. I'd rather we had <code>cargo-edit</code> built-in instead.</p>



<a name="200573954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200573954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mental <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200573954">(Jun 11 2020 at 17:05)</a>:</h4>
<p>I feel like if this leads anywhere it should be an extra component with cargo, I like the idea of having popular crates ready but I fear versioning would be the complicated question, maybe <a href="http://crates.io">crates.io</a> can hoist up a LTS version of a crate and it can target that? or as <span class="user-mention" data-user-id="260325">@Chris Denton</span> said like a group of crates that would move faster than std with releases.</p>



<a name="200574091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200574091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200574091">(Jun 11 2020 at 17:06)</a>:</h4>
<p>I don't know of any crates that have an LTS version.</p>



<a name="200574284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200574284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200574284">(Jun 11 2020 at 17:08)</a>:</h4>
<blockquote>
<p>LTS version</p>
</blockquote>
<p>Then again you end up with duplicates in your dependency tree because one maintainer upgrades quickly and another sticks to the LTS version because that's what <code>rustup</code> has.</p>



<a name="200574666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200574666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200574666">(Jun 11 2020 at 17:10)</a>:</h4>
<p>Well I was specifically referring to non-"1.0" crates not working without such a specification. Keep in mind we also have an "edition" key in <code>Cargo.toml</code> that is more or less mandatory. What if we were to only accept stable crates in the first place (yes, that sucks for <code>rand</code>) and have lts-like releases of this list of very stable crates with a similar key in <code>Cargo.toml</code> that is initialized with <code>cargo init</code>.</p>



<a name="200574766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200574766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200574766">(Jun 11 2020 at 17:11)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> serde "1.0" is more or less an LTS release, right? It hasn't bumped to a SemVer incompatible version in years.</p>



<a name="200575500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200575500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mental <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200575500">(Jun 11 2020 at 17:16)</a>:</h4>
<p>I don't think all this is really worth it when it's just avoiding having to type an extra line in <code>Cargo.toml</code></p>



<a name="200578832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200578832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200578832">(Jun 11 2020 at 17:36)</a>:</h4>
<p>Inserting <code>edition = "2018"</code> is also just avoiding to type a single extra line. It's still worth it, I think. It communicates a consensus for the current best practice of new projects as well as a simplification for new developers. Javing to lookup on <code>crates.io</code> if there have been any more recent releases and remembering the latest major versions to insert in new projects is some overhead.<br>
And because it would signal accepted best practice, maybe it could be integrated in deprecation warnings as well. For example, if <code>tempdir</code> had been included in such a system we could lint towards moving to <code>tempfile</code> in the newer releases of LTS packages.</p>



<a name="200580894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200580894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mental <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200580894">(Jun 11 2020 at 17:50)</a>:</h4>
<p>A user would probably never need to touch <code>edition</code> (at most? probably once.) dependencies get looked at and updated more frequently and chances are users will be circling <a href="http://docs.rs">docs.rs</a> or <a href="http://crates.io">crates.io</a> or some tooling will tell them that the deps are out of date.</p>



<a name="200582377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200582377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200582377">(Jun 11 2020 at 18:00)</a>:</h4>
<p>Better tooling like <a href="https://github.com/serayuzgur/crates/">https://github.com/serayuzgur/crates/</a> or <code>cargo-edit</code> can also help here. I think it can have a larger impact than adding implicit dependencies to some LTS versions that a lot of people wouldn't even want to use. The latter also requires not compiling those implicit dependencies unless they're used à la <a href="https://github.com/rust-lang/rust/issues/57274">#57274</a>.</p>



<a name="200585500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200585500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200585500">(Jun 11 2020 at 18:23)</a>:</h4>
<p>Well, the hopes are that there are not too many major version changes and you'd not need to touch that field too much as well. Only when dependencies you actuall use have had breaking changes should you have to consider updating the field.</p>



<a name="200585610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200585610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200585610">(Jun 11 2020 at 18:24)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> Good point, if <code>cargo edit</code> had such a list easily accessible and ready to insert that would be an alternative.</p>



<a name="200587146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200587146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200587146">(Jun 11 2020 at 18:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60/near/200574766">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> serde "1.0" is more or less an LTS release, right? It hasn't bumped to a SemVer incompatible version in years.</p>
</blockquote>
<p>New features are still added (see <a href="https://github.com/serde-rs/serde/releases">https://github.com/serde-rs/serde/releases</a>), so it is not an LTS release. An LTS release only gets bugfixes.</p>



<a name="200590506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200590506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200590506">(Jun 11 2020 at 19:03)</a>:</h4>
<p>And there's serde and miniserde with just support for the most common formats, like JSON, and which is much simpler (and IIRC faster)</p>



<a name="200592978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200592978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200592978">(Jun 11 2020 at 19:24)</a>:</h4>
<p>Only giving bugfixes certainly is RedHats interpretation but I don't think that is universally accepted or implied. In fact, the practice of classifying something as a security fix to backport to an LTS is not unheard of . (I can get a reference for that statement).</p>



<a name="200593846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200593846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200593846">(Jun 11 2020 at 19:30)</a>:</h4>
<p>This seems very similar to the "Rust Platform" idea that was floated a few years back. <a href="http://aturon.github.io/tech/2016/07/27/rust-platform/">http://aturon.github.io/tech/2016/07/27/rust-platform/</a></p>
<p>I'd recommend doing some research on that proposal and figuring out how to resolve the objections raised to it since they pretty much all seem to apply to this idea.</p>



<a name="200594443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200594443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200594443">(Jun 11 2020 at 19:35)</a>:</h4>
<p>Doesn't that sound like the old stdx? <a href="https://github.com/brson/stdx">https://github.com/brson/stdx</a></p>



<a name="200632218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200632218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200632218">(Jun 12 2020 at 03:40)</a>:</h4>
<blockquote>
<p>You can utilize UB with a known compiler. You can know that the compiler will not do anything non-deterministic when invoking a certain kind of UB. For example C depending on the evaluation order of subexpressions is UB, but I don't know of any compiler that doesn't just choose a certain evaluation order.</p>
</blockquote>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> <br>
This is not undefined behavior, this is unspecified behavior. The standard treats them very differently: </p>
<ul>
<li>unspecified behavior must be documented and is usually only one of a few limited options</li>
<li>undefined behavior has no specification at all and can eat your hard drive</li>
</ul>
<p>Both are not explicitly specified, but there is a world of difference between the two.</p>



<a name="200632349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/An%20alternative%20to%20inclusion%20in%20%60std%60/near/200632349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/An.20alternative.20to.20inclusion.20in.20.60std.60.html#200632349">(Jun 12 2020 at 03:44)</a>:</h4>
<p>Another example of unspecified behavior is the size of <code>int</code>: it is not stable, it can change in any compiler release, but you know that it's always <code>size_t</code> and you know it's always <code>&gt;= sizeof(char)</code>. Contrast this with derefencing a null pointer, which is <em>never</em> valid.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>